<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加商品</title>
    <script src="../js/jquery-1.12.4.min.js"></script>
<!--    <script src="../js/plugins/ueditor/ueditor.config.js"></script>-->
<!--    <script src="../js/plugins/ueditor/ueditor.all.min.js"></script>-->
<!--    <script src="../js/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>-->
    <script src="./js/tinymce.min.js"></script>
    <script src="./js/wx.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html,body{
            padding:0;
            margin:0;
            font-family: PingFang-SC-Light;
            font-size:12px;
            width:100%;
        }
        .container{
            padding:12px;
        }
        .item{
            margin-bottom:10px;
            display: flex;
        }
        .item span{
            display:inline-block;
            font-size:14px;
            font-weight:500;
            margin-right:10px;
            vertical-align: middle;
        }
        .item input{
            height:30px;
            padding:0 10px;
            font-size:14px;
            display: inline-block;
            width:80%;
            border:1px solid #ccc;
            background:#fff;
            border-radius: 5px;
        }
        .item input::placeholder{
            color:#888888;
        }
        .item input:focus{
            border-color:#C02C38;
            outline: 0 none;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="item">
            <span class="name">名称*</span>
            <input type="text" placeholder="请填写商品名称" id="title">
        </div>
        <div class="item">
            <span class="name">标签*</span>
            <input type="text" placeholder="请填写商品标签，多个标签逗号分隔" id="sign">
        </div>
        <div class="item">
            <span class="name">地址*</span>
            <input type="text" placeholder="请填写商品名称" id="address">
        </div>
        <div class="item">
            <span class="name">分类*</span>
            <select name="cate_id" id="cate_id">

            </select>
        </div>
        <div class="item">
            <span>型号*</span>
            <div class="btn btn-add">+</div>
        </div>
        <div class="item">
            <span>主图</span>
            <div class="btn" ref="img"></div>
        </div>
        <div class="item">
            <span>详情</span>

        </div>
        <div class="item">
            <textarea name="content" id="content" ></textarea>
        </div>
        <script id="editor" type="text/plain"  style="width:100%;height:300px;" ></script>
        <script type="text/javascript">
            tinymce.init({
                selector: '#content',
                branding: false,
                menu: {
                    file: {title: '文件', items: 'newdocument'},
                    edit: {title: '编辑', items: 'undo redo | cut copy paste pastetext | selectall'},
                    insert: {title: '插入', items: 'link media | template hr'},
                    view: {title: '查看', items: 'visualaid'},
                    format: {title: '格式', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
                    table: {title: '表格', items: 'inserttable tableprops deletetable | cell row column'},
                    tools: {title: '工具', items: 'spellchecker code'}
                },
                removed_menuitems:'file',
                mobile: {
                    menubar: true
                }
            });
            $(function(){
                $.ajax({
                    url:'http://192.168.18.2:20054/api/get_token?p=w',
                    type:"get",
                    success:function(res){
                        console.log(res);
                    }
                })
            })
            //实例化编辑器
            var ue = UE.getEditor('content',{
                initialFrameWidth: '100%',
                initialFrameHeight: 200,
            });

            ue.ready(function () {
                ue.execCommand('serverparam', {
                    '_token': '{{csrf_token()}}',
                    'filetype': 'FT_ARTICLE_DESC',
                    'itemid': '0'
                });
            });
        </script>
    </div>


</body>
</html>